Skip to content

Update ty results for v0.0.65 - #2325

Merged
JelleZijlstra merged 1 commit into
python:mainfrom
charliermarsh:charlie/update-ty-results-0.0.65
Jul 31, 2026
Merged

Update ty results for v0.0.65#2325
JelleZijlstra merged 1 commit into
python:mainfrom
charliermarsh:charlie/update-ty-results-0.0.65

Conversation

@charliermarsh

Copy link
Copy Markdown
Contributor

Updates ty's conformance results from v0.0.50 to v0.0.65.

@charliermarsh
charliermarsh marked this pull request as ready for review July 31, 2026 17:36
@JelleZijlstra
JelleZijlstra merged commit 3410759 into python:main Jul 31, 2026
5 checks passed
charliermarsh added a commit to astral-sh/ruff that referenced this pull request Jul 31, 2026
## Summary

Reject specialization of a subclass after all generic parameters in its
bases have been specialized, including by defaults.

```python
T = TypeVar("T")
DefaultT = TypeVar("DefaultT", default=str)

class Base(Generic[T, DefaultT]): ...
class Child(Base[int]): ...

Child[bytes]  # error: Child is not generic
```

The existing fallback treated any class with `Generic` anywhere in its
MRO as generic. That fallback predates our support for legacy generic
contexts and is now overly broad: `Generic` remains in the runtime MRO
even when the class has no free type variables. Actual generic class
literals are already accepted through their generic context, so we can
remove the MRO fallback and report `not-subscriptable` for other
classes.

This brings ty into conformance with the
`generics_defaults_specialization.py` case from
[python/typing#2325](python/typing#2325) and
adds focused mdtest coverage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants